import request from "../utils/request.js"

// 获取轮播图数据
export const getSwiperList = () => {
	return request({
		url: '/home/swiperdata'
	})
}


// 获取导航数据
export const getNavList = () => {
	return request({
		url: '/home/catitems'
	})
}

// 获取楼层数据
export const getFloorList = () => {
	return request({
		url: '/home/floordata'
	})
}

// 获取楼层数据
export const getCateList = () => {
	return request({
		url: '/categories'
	})
}

// 获取搜索结果
export const searchResults = (params) => {
	return request({
		url: '/goods/qsearch',
		params
	})
}

// 获取商品列表
export const getGoodsList = (params) => {
	return request({
		url: '/goods/search',
		params
	})
}

// 获取商品详情
export const getGoodsDetail = (id) => {
	return request({
		url: '/goods/detail',
		params: {
			goods_id: id
		}
	})
}

// 登录
export const login = data => {
	return request({
		url: '/users/wxlogin',
		method: 'post',
		data
	})
}

// 创建
export const createOrder = data => {
	return request({
		url: '/my/orders/create',
		method: 'post',
		data
	})
}

export const mylogin = data => {
	return request({
		url: 'users/wxlogin',
		method: 'post',
		data
	})
}
